<template>
  <div class="jbjhwh">
    <div class="selected-module">
      <el-card>
        <i class="el-icon-search"></i>
        <div class="select-item">
          <span>集备标题：</span>
          <el-input v-model="processName" placeholder="请输入内容" clearable></el-input>
        </div>
        <div class="select-item">
          <span>日期：</span>
          <el-date-picker
            v-model="startData"
            type="date"
            placeholder="选择开始日期">
          </el-date-picker>
          <el-date-picker
            v-model="endData"
            type="date"
            placeholder="选择结束日期">
          </el-date-picker>
        </div>
        <div class="select-item">
          <span>操作步骤:</span>
          <el-select v-model="value1" placeholder="请选择">
            <el-option
              v-for="item in optionsValue1"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </div>
        <div class="btn-group">
          <el-button type="primary">查询</el-button>
          <el-button type="danger">清除条件</el-button>
        </div>
      </el-card>
    </div>
    <div class="table-module">
      <el-card>
        <!--<div class="btn-group">-->
          <!--<el-button type="primary" @click="addRecord">新增计划</el-button>-->
          <!--&lt;!&ndash;<el-button type="danger" @click="deleteRecord">删除记录</el-button>&ndash;&gt;-->
        <!--</div>-->
        <el-table
          :data="tableData"
          border
          style="width: 100%">
          <el-table-column
            label="主备人"
            prop="Participant"
            width="50">
          </el-table-column>
          <el-table-column
            prop="Title"
            label="标题"
            width="180">
          </el-table-column>
          <el-table-column
            prop="Founder"
            label="说明"
            width="180">
          </el-table-column>
          <el-table-column
            prop="Participant"
            label="创建人"
            width="180">
          </el-table-column>
          <el-table-column
            prop="Explain"
            label="操作步骤">
          </el-table-column>
          <el-table-column
            label="操作"
            width="120">
            <template slot-scope="scope">
              <el-button
                @click.native.prevent="handleClick(scope.$index, tableData)"
                type="text"
                size="small">
                发起
              </el-button>
              <el-button
                @click.native.prevent="handleClick(scope.$index, tableData)"
                type="text"
                size="small">
                删除
              </el-button>
            </template>
          </el-table-column>
          <el-table-column
            prop="CreateTime"
            label="创建日期">
          </el-table-column>
        </el-table>
      </el-card>
    </div>
    <div class="dialog-module">
      <el-dialog title="新增" :visible.sync="dialogAddVisible" custom-class="add-dialog">
        <div class="content">
          <i class="el-icon-search"></i>
          <div class="content-item">
            <span>调课流程：</span>
            <el-select v-model="dialogValue1" placeholder="请选择">
              <el-option
                v-for="item in dialogValue1Options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </div>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogAddVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogAddVisible = false">确 定</el-button>
        </div>
      </el-dialog>
      <!--再加一个用以前的弹框来响应下一步-->
    </div>
  </div>
</template>

<style lang="scss" scoped>
  .jbjhwh {
    .selected-module {
      .el-icon-search {
        font-size: 34px;
      }
      .select-item {
        display: inline-block;
        margin-right: 20px;
        .el-input, .el-select {
          display: inline-block;
          width: 150px;
        }
      }
      .btn-group {
        float: right;
      }
    }
    .table-module {
      .btn-group {
        margin-bottom: 10px;
      }
    }
    .dialog-module {
      .content {
        .el-icon-search {
          font-size: 34px;
          margin-right: 20px;
        }
        .content-item {
          display: inline-block;
          margin-right: 20px;
          .el-select {
            display: inline-block;
            width: 200px;
          }
        }
      }
    }
  }
</style>

<script>
  import {getToken} from "../../utils/auth";
  export default {
    data() {
      return {
        value1: '',
        optionsValue1: [
          {
            value: '已创建代发起',
            label: '已创建代发起'
          },
          {
            value: '已创建进行中',
            label: '已创建进行中'
          }
        ],
        processName: '',
        tableData: [],
        startData: '',
        endData: '',
        dialogAddVisible: false,
        dialogValue1: '',
        dialogValue1Options: [
          {
            value: '选项1',
            label: '黄金糕'
          }, {
            value: '选项2',
            label: '双皮奶'
          }, {
            value: '选项3',
            label: '蚵仔煎'
          }, {
            value: '选项4',
            label: '龙须面'
          }, {
            value: '选项5',
            label: '北京烤鸭'
          }
        ]
      }
    },
    methods: {
      handleClick() {

      },
      addRecord() {
        this.dialogAddVisible = true
      },
      deleteRecord() {

      },
      async loadTableData() {
        let params = {
          token: getToken(),
          index: this.currentIndex,
          pagemax: this.showPage,
          title: '',
          status: '',
          founder: '',
          part: '',
        }
        let res = await this.axios.get('v1/jbgl/plan/getdata', {params})
        console.log(res)
        this.tableData = res.data.data
      },
    },
    created() {
      this.loadTableData()
    }
  }
</script>
